package com.lagou.controller;

import com.lagou.pojo.BaseResponse;
import com.lagou.pojo.DataBaseEntity;
import com.lagou.service.ZkConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author
 */
@CrossOrigin
@RestController
public class ZkConfigController {

    @Autowired
    private ZkConfigService zkConfigService;

    @RequestMapping(value = "/config", method = RequestMethod.POST)
    public BaseResponse updateDataBase(@RequestBody DataBaseEntity dataBaseEntity) {
        try {
            zkConfigService.updateDBConfig(dataBaseEntity);
            return BaseResponse.SUCCESS();
        } catch (Exception e) {
            e.printStackTrace();
            return BaseResponse.FAIL();
        }
    }


}


